<?php

namespace App\Admin\Controllers;

use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;
use \App\Models\ScenicDivination;
use \App\Models\Divination;
use \App\Models\ScenicArea;
use \App\Models\Category;
use Encore\Admin\Facades\Admin;
use App\Services\MakeProductThumbnail\MakeProductThumbnail;
use App\Admin\Actions\DivinationAction\MakeDeepThink;

class ScenicAreaController extends AdminController
{
    protected $title = '景区管理';
    
    protected function grid()
    {
        $grid = new Grid(new ScenicArea());

	    $grid->disableExport();
	
	    $grid->column('id', 'ID');
	    $grid->column('name', '景区名称');
	   
	    $grid->column('created_at', '创建时间')->display(function () {
		    return $this->created_at->toDatetimeString();
	    });
	
	    $grid->disableRowSelector();
        return $grid;
    }

    
	
	 protected function detail($id)
    {
        $show = new Show(ScenicArea::findOrFail($id));
        return $show;
    }
	
    protected function form()
    {
        $form = new Form(new ScenicArea());
	    $form->text('name', '景区名称')->rules('required');
        return $form;
    }

   
}
